package com.dhwl.hsh.driver.ui.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.dhwl.hsh.lib.view.viewpagerindicator.IconPagerAdapter;
import com.dhwl.hsh.driver.R;
import com.dhwl.hsh.driver.ui.fragment.OrderListFragment;

/**
 * 简要描述
 *
 * @author Derek.Kidd
 * @version V1.0.0
 * @date 2016-04-22 15:56
 */
public class OrderTabPageAdapter extends FragmentPagerAdapter implements IconPagerAdapter {


    private static final int[] TITLE = new int[]{R.string.order_status_for_ship,
            R.string.order_status_for_verify, R.string.order_status_for_comment, R.string.order_status_all};

    private Context mContext;

    public OrderTabPageAdapter(Context context, FragmentManager fm) {
        super(fm);
        this.mContext = context;
    }

    @Override
    public Fragment getItem(int position) {
        return new OrderListFragment();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mContext.getString(TITLE[position % TITLE.length]);
    }

    @Override
    public int getCount() {
        return TITLE.length;
    }

    @Override
    public int getIconResId(int index) {
        return 0;
    }
}
